Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all architectures using 'org.tensorflow:tensorflow-android' dependency #1

Merged
merged 3 commits into from
Sep 2, 2017

Conversation

daj
Copy link
Contributor

@daj daj commented Aug 13, 2017

The org.tensorflow:tensorflow-android:1.2.0 dependency downloads an AAR file which includes native binaries for all architectures, along with a Java interface (TensorFlowInferenceInterface) than can be used to interface with TensorFlow model, all without needing to write any JNI code!

Documentation:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/android

I've written this blog post providing a bit more background information:
https://medium.com/@daj/using-a-pre-trained-tensorflow-model-on-android-e747831a3d6

This PR also includes commits to remove IDE warnings due to:

  • Logging tag exceeding 23 char maximum.
  • Trace class requiring API level 18, even though the project supports API level 14.

TESTING

Before these changes, I could not install the app on my Android 7.0 x86 emulator. It failed with this message:
Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

After the change, I was successfully able to launch the app and Detect digits. :-)

screen shot 2017-08-12 at 10 05 59 pm

daj added 3 commits August 12, 2017 21:30
Otherwise Android Studio shows warnings for every log line
This will work on API levels less than 18
I’ve copied the approach used by the Android Things sample app:
https://github.com/androidthings/sample-tensorflow-imageclassifier

This dependency downloads an AAR file which includes native binaries for all architectures, along with a Java interface (TensorFlowInferenceInterface) than can be used  to interface with TensorFlow model without needing to write any JNI code!  Documentation:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/android

TESTING

Before these changes, I could not install the app on my Android 7.0 x86 emulator.  It failed with this message:
`Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]`

After the change, I was successfully able to launch the app and Detect digits. :-)
@amitshekhariitbhu amitshekhariitbhu merged commit 0fc8b4e into amitshekhariitbhu:master Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants